
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <title>Step 1: Testing Connectivity to a Server &#8212; SSLyze 3.0.8 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <script src="_static/language_data.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Step 2: Running Scan Commands Against a Server" href="running-scan-commands.html" />
    <link rel="prev" title="Appendix: Scan Commands" href="available-scan-commands.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  <div class="section" id="module-sslyze">
<span id="step-1-testing-connectivity-to-a-server"></span><h1><a class="toc-backref" href="#id3">Step 1: Testing Connectivity to a Server</a><a class="headerlink" href="#module-sslyze" title="Permalink to this headline">¶</a></h1>
<div class="contents topic" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#module-sslyze" id="id3">Step 1: Testing Connectivity to a Server</a></p>
<ul>
<li><p><a class="reference internal" href="#basic-example" id="id4">Basic Example</a></p></li>
<li><p><a class="reference internal" href="#advanced-usage" id="id5">Advanced Usage</a></p>
<ul>
<li><p><a class="reference internal" href="#main-classes-for-connectivity-testing" id="id6">Main classes for connectivity testing</a></p></li>
<li><p><a class="reference internal" href="#additional-settings-starttls-sni-etc" id="id7">Additional settings: StartTLS, SNI, etc.</a></p></li>
<li><p><a class="reference internal" href="#running-a-scan-through-a-proxy" id="id8">Running a scan through a proxy</a></p></li>
<li><p><a class="reference internal" href="#enabling-ssl-tls-client-authentication" id="id9">Enabling SSL/TLS client authentication</a></p></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="basic-example">
<h2><a class="toc-backref" href="#id4">Basic Example</a><a class="headerlink" href="#basic-example" title="Permalink to this headline">¶</a></h2>
<p>Before a server can be scanned, SSLyze must validate that it is able to connect to the server. This is done using
the <code class="docutils literal notranslate"><span class="pre">ServerConnectivityTester</span></code> class:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">basic_example_connectivity_testing</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
    <span class="c1"># Define the server that you want to scan</span>
    <span class="n">server_location</span> <span class="o">=</span> <span class="n">ServerNetworkLocationViaDirectConnection</span><span class="o">.</span><span class="n">with_ip_address_lookup</span><span class="p">(</span><span class="s2">&quot;www.google.com&quot;</span><span class="p">,</span> <span class="mi">443</span><span class="p">)</span>

    <span class="c1"># Do connectivity testing to ensure SSLyze is able to connect</span>
    <span class="k">try</span><span class="p">:</span>
        <span class="n">server_info</span> <span class="o">=</span> <span class="n">ServerConnectivityTester</span><span class="p">()</span><span class="o">.</span><span class="n">perform</span><span class="p">(</span><span class="n">server_location</span><span class="p">)</span>
    <span class="k">except</span> <span class="n">ConnectionToServerFailed</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
        <span class="c1"># Could not connect to the server; abort</span>
        <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Error connecting to </span><span class="si">{</span><span class="n">server_location</span><span class="si">}</span><span class="s2">: </span><span class="si">{</span><span class="n">e</span><span class="o">.</span><span class="n">error_message</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
        <span class="k">return</span>
    <span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;Connectivity testing completed: </span><span class="si">{</span><span class="n">server_info</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>If the call to <code class="docutils literal notranslate"><span class="pre">perform()</span></code> is successful, it returns a <code class="docutils literal notranslate"><span class="pre">ServerConnectivityInfo</span></code> object that
can then be used for scanning the server.</p>
<p>This is described in <a class="reference internal" href="running-scan-commands.html"><span class="doc">Step 2: Running Scan Commands Against a Server</span></a>.</p>
</div>
<div class="section" id="advanced-usage">
<h2><a class="toc-backref" href="#id5">Advanced Usage</a><a class="headerlink" href="#advanced-usage" title="Permalink to this headline">¶</a></h2>
<p>When calling <code class="docutils literal notranslate"><span class="pre">ServerConnectivityTester.perform()</span></code>, a <code class="docutils literal notranslate"><span class="pre">ServerNetworkConfiguration</span></code> can be optionally provided as the
second argument, in order to have more control on how SSLyze should connect to the server. This configuration object
allows for example to configure StarTLS or a client certificate SSL/TLS client authentication.</p>
<div class="section" id="main-classes-for-connectivity-testing">
<h3><a class="toc-backref" href="#id6">Main classes for connectivity testing</a><a class="headerlink" href="#main-classes-for-connectivity-testing" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt id="sslyze.ServerNetworkLocationViaDirectConnection">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ServerNetworkLocationViaDirectConnection</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hostname</span></em>, <em class="sig-param"><span class="n">port</span></em>, <em class="sig-param"><span class="n">ip_address</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerNetworkLocationViaDirectConnection" title="Permalink to this definition">¶</a></dt>
<dd><p>All the information needed to connect to a server directly.</p>
<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaDirectConnection.hostname">
<code class="sig-name descname">hostname</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaDirectConnection.hostname" title="Permalink to this definition">¶</a></dt>
<dd><p>The server’s hostname.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaDirectConnection.port">
<code class="sig-name descname">port</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaDirectConnection.port" title="Permalink to this definition">¶</a></dt>
<dd><p>The server’s TLS port number.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaDirectConnection.ip_address">
<code class="sig-name descname">ip_address</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaDirectConnection.ip_address" title="Permalink to this definition">¶</a></dt>
<dd><p>The server’s IP address. If you do not have the server’s IP address, instantiate this class using
<cite>with_ip_address_lookup()</cite> to do a DNS lookup for the specified <cite>hostname</cite>.</p>
</dd></dl>

<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hostname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>port</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
<li><p><strong>ip_address</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="sslyze.ServerNetworkLocationViaDirectConnection.with_ip_address_lookup">
<em class="property">classmethod </em><code class="sig-name descname">with_ip_address_lookup</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hostname</span></em>, <em class="sig-param"><span class="n">port</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerNetworkLocationViaDirectConnection.with_ip_address_lookup" title="Permalink to this definition">¶</a></dt>
<dd><p>Helper factory method to automatically do a DNS lookup of the supplied hostname.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hostname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>port</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">ServerNetworkLocationViaDirectConnection</span></code></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="sslyze.ServerConnectivityTester">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ServerConnectivityTester</code><a class="headerlink" href="#sslyze.ServerConnectivityTester" title="Permalink to this definition">¶</a></dt>
<dd><p>Utility class to ensure that SSLyze is able to connect to a server before scanning it.</p>
<dl class="py method">
<dt id="sslyze.ServerConnectivityTester.perform">
<code class="sig-name descname">perform</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">server_location</span></em>, <em class="sig-param"><span class="n">network_configuration</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerConnectivityTester.perform" title="Permalink to this definition">¶</a></dt>
<dd><p>Attempt to perform a full SSL/TLS handshake with the server.</p>
<p>This method will ensure that the server can be reached, and will also identify one SSL/TLS version and one
cipher suite that is supported by the server.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>server_location</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ServerNetworkLocation</span></code>) – </p></li>
<li><p><strong>network_configuration</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">ServerNetworkConfiguration</span></code>]) – </p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">ServerConnectivityInfo</span></code></p>
</dd>
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>An object encapsulating all the information needed to connect to the server, to be passed to a <cite>Scanner</cite> in
order to run scan commands against the server.</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ServerConnectivityError</strong> – If the server was not reachable or an SSL/TLS handshake could not be completed.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="sslyze.ServerConnectivityInfo">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ServerConnectivityInfo</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">server_location</span></em>, <em class="sig-param"><span class="n">network_configuration</span></em>, <em class="sig-param"><span class="n">tls_probing_result</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerConnectivityInfo" title="Permalink to this definition">¶</a></dt>
<dd><p>All the settings (hostname, port, SSL version, etc.) needed to successfully connect to a given SSL/TLS server.</p>
<p>Such objects should never be instantiated directly and are instead returned by <cite>ServerConnectivityTester.perform()</cite>
when connectivity testing was successful.</p>
<dl class="py attribute">
<dt id="sslyze.ServerConnectivityInfo.server_location">
<code class="sig-name descname">server_location</code><a class="headerlink" href="#sslyze.ServerConnectivityInfo.server_location" title="Permalink to this definition">¶</a></dt>
<dd><p>The minimum information needed to establish a connection to the server.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerConnectivityInfo.network_configuration">
<code class="sig-name descname">network_configuration</code><a class="headerlink" href="#sslyze.ServerConnectivityInfo.network_configuration" title="Permalink to this definition">¶</a></dt>
<dd><p>Some additional configuration regarding how to connect to the server.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerConnectivityInfo.tls_probing_result">
<code class="sig-name descname">tls_probing_result</code><a class="headerlink" href="#sslyze.ServerConnectivityInfo.tls_probing_result" title="Permalink to this definition">¶</a></dt>
<dd><p>Some additional details about the server’s TLS configuration.</p>
</dd></dl>

<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>server_location</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ServerNetworkLocation</span></code>) – </p></li>
<li><p><strong>network_configuration</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ServerNetworkConfiguration</span></code>) – </p></li>
<li><p><strong>tls_probing_result</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">ServerTlsProbingResult</span></code>) – </p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="id0">
<code class="sig-name descname">server_location</code><em class="property">: ServerNetworkLocation</em><em class="property"> = None</em><a class="headerlink" href="#id0" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="id1">
<code class="sig-name descname">network_configuration</code><em class="property">: ServerNetworkConfiguration</em><em class="property"> = None</em><a class="headerlink" href="#id1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="id2">
<code class="sig-name descname">tls_probing_result</code><em class="property">: ServerTlsProbingResult</em><em class="property"> = None</em><a class="headerlink" href="#id2" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="sslyze.ServerConnectivityInfo.get_preconfigured_tls_connection">
<code class="sig-name descname">get_preconfigured_tls_connection</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">override_tls_version</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">ca_certificates_path</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">should_use_legacy_openssl</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">should_enable_server_name_indication</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerConnectivityInfo.get_preconfigured_tls_connection" title="Permalink to this definition">¶</a></dt>
<dd><p>Get an SSLConnection instance with the right SSL configuration for successfully connecting to the server.</p>
<p>Used by all plugins to connect to the server and run scans.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>override_tls_version</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">TlsVersionEnum</span></code>]) – </p></li>
<li><p><strong>ca_certificates_path</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code>]) – </p></li>
<li><p><strong>should_use_legacy_openssl</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>]) – </p></li>
<li><p><strong>should_enable_server_name_indication</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">bool</span></code>) – </p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><code class="xref py py-class docutils literal notranslate"><span class="pre">SslConnection</span></code></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="additional-settings-starttls-sni-etc">
<h3><a class="toc-backref" href="#id7">Additional settings: StartTLS, SNI, etc.</a><a class="headerlink" href="#additional-settings-starttls-sni-etc" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt id="sslyze.ServerNetworkConfiguration">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ServerNetworkConfiguration</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tls_server_name_indication</span></em>, <em class="sig-param"><span class="n">tls_opportunistic_encryption</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">tls_client_auth_credentials</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">xmpp_to_hostname</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">network_timeout</span><span class="o">=</span><span class="default_value">5</span></em>, <em class="sig-param"><span class="n">network_max_retries</span><span class="o">=</span><span class="default_value">3</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerNetworkConfiguration" title="Permalink to this definition">¶</a></dt>
<dd><p>Additional network settings to provide fine-grained control on how to connect to a specific server.</p>
<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.tls_server_name_indication">
<code class="sig-name descname">tls_server_name_indication</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.tls_server_name_indication" title="Permalink to this definition">¶</a></dt>
<dd><p>The hostname to set within the Server Name Indication TLS extension.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.tls_wrapped_protocol">
<code class="sig-name descname">tls_wrapped_protocol</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.tls_wrapped_protocol" title="Permalink to this definition">¶</a></dt>
<dd><p>The protocol wrapped in TLS that the server expects. It allows SSLyze to figure out
how to establish a (Start)TLS connection to the server and what kind of “hello” message
(SMTP, XMPP, etc.) to send to the server after the handshake was completed. If not supplied, standard
TLS will be used.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.tls_client_auth_credentials">
<code class="sig-name descname">tls_client_auth_credentials</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.tls_client_auth_credentials" title="Permalink to this definition">¶</a></dt>
<dd><p>The client certificate and private key needed to perform mutual authentication
with the server. If not supplied, SSLyze will attempt to connect to the server without performing
client authentication.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.xmpp_to_hostname">
<code class="sig-name descname">xmpp_to_hostname</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.xmpp_to_hostname" title="Permalink to this definition">¶</a></dt>
<dd><p>The hostname to set within the <cite>to</cite> attribute of the XMPP stream. If not supplied, the
server’s hostname will be used. Should only be set if the supplied <cite>tls_wrapped_protocol</cite> is an
XMPP protocol.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.network_timeout">
<code class="sig-name descname">network_timeout</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.network_timeout" title="Permalink to this definition">¶</a></dt>
<dd><p>The timeout (in seconds) to be used when attempting to establish a connection to the
server.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkConfiguration.network_max_retries">
<code class="sig-name descname">network_max_retries</code><a class="headerlink" href="#sslyze.ServerNetworkConfiguration.network_max_retries" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of retries SSLyze will perform when attempting to establish a connection
to the server.</p>
</dd></dl>

<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>tls_server_name_indication</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>tls_opportunistic_encryption</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">ProtocolWithOpportunisticTlsEnum</span></code>]) – </p></li>
<li><p><strong>tls_client_auth_credentials</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">ClientAuthenticationCredentials</span></code>]) – </p></li>
<li><p><strong>xmpp_to_hostname</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – </p></li>
<li><p><strong>network_timeout</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
<li><p><strong>network_max_retries</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ProtocolWithOpportunisticTlsEnum</code><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum" title="Permalink to this definition">¶</a></dt>
<dd><p>The list of plaintext protocols supported by SSLyze for opportunistic TLS upgrade (such as STARTTLS).</p>
<p>This allows SSLyze to figure out how to complete an SSL/TLS handshake with the server.</p>
<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.SMTP">
<code class="sig-name descname">SMTP</code><em class="property"> = 1</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.SMTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.XMPP">
<code class="sig-name descname">XMPP</code><em class="property"> = 2</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.XMPP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.XMPP_SERVER">
<code class="sig-name descname">XMPP_SERVER</code><em class="property"> = 3</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.XMPP_SERVER" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.FTP">
<code class="sig-name descname">FTP</code><em class="property"> = 4</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.FTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.POP3">
<code class="sig-name descname">POP3</code><em class="property"> = 5</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.POP3" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.LDAP">
<code class="sig-name descname">LDAP</code><em class="property"> = 6</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.LDAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.IMAP">
<code class="sig-name descname">IMAP</code><em class="property"> = 7</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.IMAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.RDP">
<code class="sig-name descname">RDP</code><em class="property"> = 8</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.RDP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.POSTGRES">
<code class="sig-name descname">POSTGRES</code><em class="property"> = 9</em><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.POSTGRES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="sslyze.ProtocolWithOpportunisticTlsEnum.from_default_port">
<em class="property">classmethod </em><code class="sig-name descname">from_default_port</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">port</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ProtocolWithOpportunisticTlsEnum.from_default_port" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a port number, return the protocol that uses this port number by default.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>port</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">ProtocolWithOpportunisticTlsEnum</span></code>]</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="running-a-scan-through-a-proxy">
<h3><a class="toc-backref" href="#id8">Running a scan through a proxy</a><a class="headerlink" href="#running-a-scan-through-a-proxy" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt id="sslyze.ServerNetworkLocationViaHttpProxy">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ServerNetworkLocationViaHttpProxy</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hostname</span></em>, <em class="sig-param"><span class="n">port</span></em>, <em class="sig-param"><span class="n">http_proxy_settings</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ServerNetworkLocationViaHttpProxy" title="Permalink to this definition">¶</a></dt>
<dd><p>All the information needed to connect to a server by tunneling the traffic through an HTTP proxy.</p>
<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaHttpProxy.hostname">
<code class="sig-name descname">hostname</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaHttpProxy.hostname" title="Permalink to this definition">¶</a></dt>
<dd><p>The server’s hostname.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaHttpProxy.port">
<code class="sig-name descname">port</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaHttpProxy.port" title="Permalink to this definition">¶</a></dt>
<dd><p>The server’s TLS port number.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ServerNetworkLocationViaHttpProxy.http_proxy_settings">
<code class="sig-name descname">http_proxy_settings</code><a class="headerlink" href="#sslyze.ServerNetworkLocationViaHttpProxy.http_proxy_settings" title="Permalink to this definition">¶</a></dt>
<dd><p>The HTTP proxy configuration to use in order to tunnel the scans through a proxy. The
proxy will be responsible for looking up the server’s IP address and connecting to it.</p>
</dd></dl>

<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hostname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>port</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
<li><p><strong>http_proxy_settings</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">HttpProxySettings</span></code>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="sslyze.HttpProxySettings">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">HttpProxySettings</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hostname</span></em>, <em class="sig-param"><span class="n">port</span></em>, <em class="sig-param"><span class="n">basic_auth_user</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">basic_auth_password</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.HttpProxySettings" title="Permalink to this definition">¶</a></dt>
<dd><dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hostname</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>port</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code>) – </p></li>
<li><p><strong>basic_auth_user</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – </p></li>
<li><p><strong>basic_auth_password</strong> (<code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="enabling-ssl-tls-client-authentication">
<h3><a class="toc-backref" href="#id9">Enabling SSL/TLS client authentication</a><a class="headerlink" href="#enabling-ssl-tls-client-authentication" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt id="sslyze.ClientAuthenticationCredentials">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">ClientAuthenticationCredentials</code><span class="sig-paren">(</span><em class="sig-param">certificate_chain_path</em>, <em class="sig-param">key_path</em>, <em class="sig-param">key_password=''</em>, <em class="sig-param">key_type=&lt;OpenSslFileTypeEnum.PEM: 1&gt;</em><span class="sig-paren">)</span><a class="headerlink" href="#sslyze.ClientAuthenticationCredentials" title="Permalink to this definition">¶</a></dt>
<dd><p>Everything needed by a client to perform SSL/TLS client authentication with the server.</p>
<dl class="py attribute">
<dt id="sslyze.ClientAuthenticationCredentials.certificate_chain_path">
<code class="sig-name descname">certificate_chain_path</code><a class="headerlink" href="#sslyze.ClientAuthenticationCredentials.certificate_chain_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Path to the file containing the client’s certificate.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ClientAuthenticationCredentials.key_path">
<code class="sig-name descname">key_path</code><a class="headerlink" href="#sslyze.ClientAuthenticationCredentials.key_path" title="Permalink to this definition">¶</a></dt>
<dd><p>Path to the file containing the client’s private key.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ClientAuthenticationCredentials.key_password">
<code class="sig-name descname">key_password</code><a class="headerlink" href="#sslyze.ClientAuthenticationCredentials.key_password" title="Permalink to this definition">¶</a></dt>
<dd><p>The password to decrypt the private key.</p>
</dd></dl>

<dl class="py attribute">
<dt id="sslyze.ClientAuthenticationCredentials.key_type">
<code class="sig-name descname">key_type</code><a class="headerlink" href="#sslyze.ClientAuthenticationCredentials.key_type" title="Permalink to this definition">¶</a></dt>
<dd><p>The format of the key file.</p>
</dd></dl>

<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>certificate_chain_path</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code>) – </p></li>
<li><p><strong>key_path</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code>) – </p></li>
<li><p><strong>key_password</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>) – </p></li>
<li><p><strong>key_type</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">OpenSslFileTypeEnum</span></code>) – </p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="sslyze.OpenSslFileTypeEnum">
<em class="property">class </em><code class="sig-prename descclassname">sslyze.</code><code class="sig-name descname">OpenSslFileTypeEnum</code><a class="headerlink" href="#sslyze.OpenSslFileTypeEnum" title="Permalink to this definition">¶</a></dt>
<dd><p>Certificate and private key format constants which map to the SSL_FILETYPE_XXX OpenSSL constants.</p>
<dl class="py attribute">
<dt id="sslyze.OpenSslFileTypeEnum.PEM">
<code class="sig-name descname">PEM</code><em class="property"> = 1</em><a class="headerlink" href="#sslyze.OpenSslFileTypeEnum.PEM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="sslyze.OpenSslFileTypeEnum.ASN1">
<code class="sig-name descname">ASN1</code><em class="property"> = 2</em><a class="headerlink" href="#sslyze.OpenSslFileTypeEnum.ASN1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
</div>
</div>


          </div>
          
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">SSLyze</a></h1>








<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation of SSLyze</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="available-scan-commands.html">Appendix: Scan Commands</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Step 1: Testing Connectivity to a Server</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#basic-example">Basic Example</a></li>
<li class="toctree-l2"><a class="reference internal" href="#advanced-usage">Advanced Usage</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#main-classes-for-connectivity-testing">Main classes for connectivity testing</a></li>
<li class="toctree-l3"><a class="reference internal" href="#additional-settings-starttls-sni-etc">Additional settings: StartTLS, SNI, etc.</a></li>
<li class="toctree-l3"><a class="reference internal" href="#running-a-scan-through-a-proxy">Running a scan through a proxy</a></li>
<li class="toctree-l3"><a class="reference internal" href="#enabling-ssl-tls-client-authentication">Enabling SSL/TLS client authentication</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="running-scan-commands.html">Step 2: Running Scan Commands Against a Server</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="index.html">Documentation overview</a><ul>
      <li>Previous: <a href="available-scan-commands.html" title="previous chapter">Appendix: Scan Commands</a></li>
      <li>Next: <a href="running-scan-commands.html" title="next chapter">Step 2: Running Scan Commands Against a Server</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" />
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>








        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;Copyright 2020 Alban Diquet.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 3.0.4</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
      
      |
      <a href="_sources/testing-connectivity.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>